package com.study.JAVA源码;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;

public class Decorator {

    public static void main(String[] args) throws IOException {

        //说明
        //1、InputStream是抽象类，类似于Drink
        //2、FileInputStream是InputStream子类，类似我们前面的单品咖啡
        //3、FilterInputStream 是InputStream子类 类似Decorator 修饰者
        //4、DataInputStream 是FilterInputStream子类，  具体的修饰者
        //5、FilterInputStream 类中聚合了被装饰者

        DataInputStream dis = new DataInputStream(new FileInputStream("abc.txt"));
        System.out.println(dis.read());
        dis.close();
    }
}
